#Requires AutoHotkey v2.0

g1:=Gui()
txt1:=g1.Add("Text","w400 h300", "")
res:=RunCmd("dir")
txt1.Text:=res
g1.Show()


RunCmd(command) {
    shell := ComObject("WScript.Shell")
    exec := shell.Exec(A_ComSpec " /c " command)
    result := exec.StdOut.ReadAll()
    return result
}
